package com.nuoniu.sibanyun.mapper.crm;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.crm.CrmHistoryRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author baiqiang
 * @since 2020-07-20
 */
@Component
@Mapper
public interface CrmHistoryRecordMapper extends BaseMapper<CrmHistoryRecord> {

    /**
     * 获取客户操作记录
     * @author 小啊刚
     * @date 2020-07-20
     */
    @Select("select * from crm_history_record where crm_id = #{crmId} and user_id = #{userId} and type = #{type} order by create_time desc limit 1")
    CrmHistoryRecord getRecord(Integer crmId, Integer userId, int type);
}
